package com.yangle.shell.util;

import java.util.Random;

/**
 * Author: yangle
 * Create Data: 2020/12/5
 */
public  class GenUniqueId {

    /**
     * 生成订单id和订单详情id
     * 当前时间+随机数
     * 多线程加锁，防止生成重复订单
     * */

    public synchronized static String getId(){
        Random random = new Random();
        Integer number = random.nextInt(900000)+100000;
        return System.currentTimeMillis()+String.valueOf(number);

    }

}
